package com.auth.common.util.security.secrecy;

import org.apache.commons.codec.digest.Md5Crypt;
import org.springframework.stereotype.Component;

@Component
public class MD5 extends SecrecyAdpter {

    private String salt = "$1$pxJS";

    @Override
    public String encrypt(String value) {
        return Md5Crypt.md5Crypt(value.getBytes(), salt);
    }

    public static void main(String[] args) {
        MD5 md5 = new MD5();
        System.out.println(md5.encrypt("ak"));
        System.out.println(md5.encrypt("ak"));
    }
}
